#pragma once
#include "device.h"


class Section :
	public Device
{
public:
	Section(void);
	Section(CWnd* pParent);
	virtual ~Section(void);
	DEF_CREATE_CALLBACK(Section)
	DECLARE_SERIAL(Section)
	virtual void Serialize(CArchive& ar);
	DECLARE_MESSAGE_MAP()
	afx_msg void OnPaint();
public:
	virtual void setWindow(const CPoint& pt1, const CPoint& pt2 = CPoint());
	virtual void setWindow();
	virtual void compressWindow();
	virtual bool setAttr(void);
	virtual BOOL checkValid(void) { return data_.pt_[1] != data_.pt_[2]; }
	virtual bool OnMouseViewMove(const CPoint& viewPt, CPoint& outPt);

	virtual void setSealFrame(CPoint pt[], int height, bool bWnd = false);
	virtual void extenDev(CPoint newPt, int connFlag);
	virtual void setNamePos(void);
public:
	struct {
		CPoint pt_[4];
		CPoint sealPt_[8];
		CPoint insuPt_[4];
#define SECTION_TOTAL_PT_COUNT  4 + 8 + 4
		int insuType_[2];
	}data_;
	void setInsuPt(void);
};

